#include "InfraredReceiving.h"
#include "IRremote.h"

// 构造函数
InfraredReceiving::InfraredReceiving(int digitalPin): IRrecv(digitalPin) {}

void InfraredReceiving::setInfraredReceivingBegin() {
    enableIRIn();
}

// 获取数据
String InfraredReceiving::getInfraredReceivingData() {
    String ir_item;
    if (decode(&results)) {
        ir_item = String(results.value, HEX);
        resume();
    }
    return ir_item;
}